OpenDriver
OpenDriver Open the device driver specified by name Str255 driverName ; address of device driver name short *refNum ; receives device driver reference number
OpenDriver opens the device driver specified by name for reading and writing. It returns the driver's reference number.
driverName is the address of a pascal-style string containing the name of the
device driver to be opened.
refNum is the address of a 16-bit short. Upon return, it will contain the
device driver reference number. This value is used in all subsequent
operations on the open driver.
noErr (0) No error
badUnitErr (-21) refNum doesn't match unit table
unitEmptyErr (-22) refNum specifies NIL handle in unit table
openErr (-23) Requested Read/Write permission and the driver's Open
permissions don't match
dInstErr (-26) Couldn't find driver in resource file
Notes: While the Sound Driver and Disk Driver open at system startup time, the
rest of the drivers are opened at the specific request of an application.
Before a driver is opened, you refer to it by name. After opening, it is
henceforth known by its reference number.